﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using VisionFrame.Base.Models;

namespace VisionFrame.Base.TemplateSelector
{
    public class NodeArgTemplateSelector : DataTemplateSelector
    {
        public DataTemplate DropdownTempalte { get; set; }
        public DataTemplate TextBoxTempalte { get; set; }
        public DataTemplate SelectFolderTempalte { get; set; }
        public DataTemplate CompareOpratorTempalte { get; set; }

        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            var model = item as NodeArgModel;
            if (model.ValueMode == 0)
                return DropdownTempalte;
            else if (model.ValueMode == 1)
                return TextBoxTempalte;
            else if (model.ValueMode == 2)
                return SelectFolderTempalte;
            else if (model.ValueMode == 3)
                return CompareOpratorTempalte;

            return null;
        }
    }
}
